Optimal. Leaf size=194 \[ -\frac{2 b^5 \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a d \left (a^2-b^2\right )^{5/2}}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a d \left (a^2-b^2\right )}-\frac{b \sec (c+d x) \left (a \left (2 a^2-5 b^2\right ) \sin (c+d x)+3 b^3\right )}{3 a d \left (a^2-b^2\right )^2}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{\sec (c+d x)}{a d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.408696, antiderivative size = 194, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 10, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.37, Rules used = {2898, 2622, 302, 207, 2696, 2866, 12, 2660, 618, 204} \[ -\frac{2 b^5 \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a d \left (a^2-b^2\right )^{5/2}}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a d \left (a^2-b^2\right )}-\frac{b \sec (c+d x) \left (a \left (2 a^2-5 b^2\right ) \sin (c+d x)+3 b^3\right )}{3 a d \left (a^2-b^2\right )^2}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{\sec (c+d x)}{a d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2898
Rule 2622
Rule 302
Rule 207
Rule 2696
Rule 2866
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\csc (c+d x) \sec ^4(c+d x)}{a+b \sin (c+d x)} \, dx &=\int \left (\frac{\csc (c+d x) \sec ^4(c+d x)}{a}-\frac{b \sec ^4(c+d x)}{a (a+b \sin (c+d x))}\right ) \, dx\\ &=\frac{\int \csc (c+d x) \sec ^4(c+d x) \, dx}{a}-\frac{b \int \frac{\sec ^4(c+d x)}{a+b \sin (c+d x)} \, dx}{a}\\ &=\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}+\frac{b \int \frac{\sec ^2(c+d x) \left (-2 a^2+3 b^2-2 a b \sin (c+d x)\right )}{a+b \sin (c+d x)} \, dx}{3 a \left (a^2-b^2\right )}+\frac{\operatorname{Subst}\left (\int \frac{x^4}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a d}\\ &=\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}-\frac{b \sec (c+d x) \left (3 b^3+a \left (2 a^2-5 b^2\right ) \sin (c+d x)\right )}{3 a \left (a^2-b^2\right )^2 d}-\frac{b \int \frac{3 b^4}{a+b \sin (c+d x)} \, dx}{3 a \left (a^2-b^2\right )^2}+\frac{\operatorname{Subst}\left (\int \left (1+x^2+\frac{1}{-1+x^2}\right ) \, dx,x,\sec (c+d x)\right )}{a d}\\ &=\frac{\sec (c+d x)}{a d}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}-\frac{b \sec (c+d x) \left (3 b^3+a \left (2 a^2-5 b^2\right ) \sin (c+d x)\right )}{3 a \left (a^2-b^2\right )^2 d}-\frac{b^5 \int \frac{1}{a+b \sin (c+d x)} \, dx}{a \left (a^2-b^2\right )^2}+\frac{\operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a d}\\ &=-\frac{\tanh ^{-1}(\cos (c+d x))}{a d}+\frac{\sec (c+d x)}{a d}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}-\frac{b \sec (c+d x) \left (3 b^3+a \left (2 a^2-5 b^2\right ) \sin (c+d x)\right )}{3 a \left (a^2-b^2\right )^2 d}-\frac{\left (2 b^5\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d}\\ &=-\frac{\tanh ^{-1}(\cos (c+d x))}{a d}+\frac{\sec (c+d x)}{a d}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}-\frac{b \sec (c+d x) \left (3 b^3+a \left (2 a^2-5 b^2\right ) \sin (c+d x)\right )}{3 a \left (a^2-b^2\right )^2 d}+\frac{\left (4 b^5\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d}\\ &=-\frac{2 b^5 \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2} d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a d}+\frac{\sec (c+d x)}{a d}+\frac{\sec ^3(c+d x)}{3 a d}+\frac{b \sec ^3(c+d x) (b-a \sin (c+d x))}{3 a \left (a^2-b^2\right ) d}-\frac{b \sec (c+d x) \left (3 b^3+a \left (2 a^2-5 b^2\right ) \sin (c+d x)\right )}{3 a \left (a^2-b^2\right )^2 d}\\ \end{align*}
Mathematica [A] time = 4.84422, size = 334, normalized size = 1.72 \[ \frac{-\frac{24 b^5 \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2}}+\frac{2 (7 a+10 b) \sin \left (\frac{1}{2} (c+d x)\right )}{(a+b)^2 \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )}+\frac{2 \sin \left (\frac{1}{2} (c+d x)\right )}{(a+b) \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )^3}+\frac{2 (10 b-7 a) \sin \left (\frac{1}{2} (c+d x)\right )}{(a-b)^2 \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )}+\frac{1}{(a+b) \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )^2}+\frac{1}{(a-b) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^2}-\frac{2 \sin \left (\frac{1}{2} (c+d x)\right )}{(a-b) \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^3}+\frac{12 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{a}-\frac{12 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{a}}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.118, size = 279, normalized size = 1.4 \begin{align*} -{\frac{1}{3\,d \left ( a+b \right ) } \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-3}}-{\frac{1}{2\,d \left ( a+b \right ) } \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-2}}-{\frac{3\,a}{2\,d \left ( a+b \right ) ^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-1}}-2\,{\frac{b}{d \left ( a+b \right ) ^{2} \left ( \tan \left ( 1/2\,dx+c/2 \right ) -1 \right ) }}-2\,{\frac{{b}^{5}}{d \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}a\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( 1/2\,dx+c/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) }-{\frac{1}{2\,d \left ( a-b \right ) } \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-2}}+{\frac{1}{3\,d \left ( a-b \right ) } \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-3}}+{\frac{3\,a}{2\,d \left ( a-b \right ) ^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-1}}-2\,{\frac{b}{d \left ( a-b \right ) ^{2} \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) }}+{\frac{1}{da}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 5.34558, size = 1546, normalized size = 7.97 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.21228, size = 416, normalized size = 2.14 \begin{align*} -\frac{\frac{6 \,{\left (\pi \left \lfloor \frac{d x + c}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )} b^{5}}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} \sqrt{a^{2} - b^{2}}} - \frac{3 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right )}{a} - \frac{2 \,{\left (3 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 6 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 6 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 9 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 2 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 8 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 6 \, a^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, a b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 3 \, a^{2} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 6 \, b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 4 \, a^{3} + 7 \, a b^{2}\right )}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]